<template>
  <div class="biddingBox">
    <div class="timeBox">
      <div class="time" v-if="$route.name == 'new_auction_Bidding_detail'">参拍时间：{{ infoData.created_at }}</div>
      <div class="time" v-if="$route.name == 'new_auction_Auction_details'">委拍时间：{{ infoData.created_at }}</div>
      <div class="statusBox" v-if="$route.name == 'new_auction_Bidding_detail'">{{ infoData.status_name }}</div>
    </div>
    <div class="good">
      <div class="good_l">
        <img :src="infoData.has_one_goods.thumb" alt="" v-if="infoData.has_one_goods" />
      </div>
      <div class="good_r" v-if="$route.name == 'new_auction_Bidding_detail'">
        <div class="good_r_title van-ellipsis" v-if="infoData.has_one_goods">{{ infoData.has_one_goods.title }}</div>
        <div class="good_r_b">
          <div class="num"><span class="txt">拍品个数：</span>{{ infoData.show_count }}</div>
          <div class="price"><span class="txt">拍品价格：</span>{{ $i18n.t("money") }}{{ infoData.once_amount }}</div>
          <div class="lotValue"><span class="txt">拍品价值：</span>{{ $i18n.t("money") }}{{ infoData.amount }}</div>
        </div>
      </div>
      <div class="good_r" v-if="$route.name == 'new_auction_Auction_details'">
        <div class="good_r_title van-ellipsis" v-if="infoData.has_one_goods">{{ infoData.has_one_goods.title }}</div>
        <div class="good_r_b">
          <div class="num"><span class="txt">拍品个数：</span>{{ infoData.goods_count }}</div>
          <div class="price"><span class="txt">拍品价格：</span>{{ $i18n.t("money") }}{{ infoData.before_amount }}</div>
          <div class="lotValue"><span class="txt">拍品价值：</span>{{ $i18n.t("money") }}{{ infoData.after_amount }}</div>
        </div>
      </div>
    </div>
    <div class="btn" v-if="$route.name == 'new_auction_Bidding_detail'">
      <div class="cancel" v-if="infoData.status == 0" @click="cancelAuction">取消参拍</div>
      <div class="cancel" @click="pickUp" v-if="infoData.usable_count">提货</div>
    </div>
  </div>
</template>
<script>
export default {
  props: ["infoData"],
  data() {
    return {};
  },
  methods: {
    pickUp() {
      this.$emit("pickUp", { id: this.infoData.id, item: this.infoData });
    },
    cancelAuction() {
      this.$emit("cancelAuction", { id: this.infoData.id });
    }
  }
};
</script>
<style lang="scss" scoped>
.biddingBox {
  margin: 0.63rem 0.78rem;
  padding: 0.97rem 0.69rem;
  box-sizing: border-box;
  background: #fff;
  border-radius: 0.5rem;
  .timeBox {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.97rem;
    .time {
      font-size: 0.81rem;
      color: #9898a1;
    }
    .statusBox {
      font-size: 0.81rem;
      color: #f15353;
    }
  }
  .btn {
    margin-top: 0.63rem;
    display: flex;
    justify-content: flex-end;
    .cancel {
      width: 4.81rem;
      height: 2rem;
      border-radius: 1.88rem;
      border: 0.03rem solid #aaaab3;
      line-height: 2rem;
      font-size: 0.81rem;
      margin-left: 0.63rem;
    }
  }
  .good {
    display: flex;
    justify-content: space-between;

    .good_r {
      flex: 1;
      overflow: hidden;
      text-align: left;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .good_r_title {
        font-weight: 500;
        font-size: 0.88rem;
      }
      .good_r_b {
        font-weight: 500;
        font-size: 0.81rem;
        .txt {
          color: #6e6e79;
        }
      }
    }
    .good_l {
      flex-shrink: 0;
      width: 5.38rem;
      height: 5.38rem;
      background: #d6d6dc;
      border-radius: 0.63rem;
      margin-right: 0.53rem;
      img {
        width: 100%;
        height: 100%;
        border-radius: 0.63rem;
      }
    }
  }
}
</style>
